<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page import="com.example.demo.bean.Goods" %>
<%@ page import="com.example.demo.Dao.DaoFactory" %>
<%@ page import="com.example.demo.service.GoodsDao" %><%--
  Created by IntelliJ IDEA.
  User: DZP
  Date: 2021/6/15
  Time: 13:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <title>更新产品</title>
    <script>
        function fun(val){
            var r=confirm("确认删除吗？");
            if(r){
                location.href="delete?op=del&id="+val;
            }
        }
    </script>

    <style>

        input{
            border:1px solid RGB(99,175,233);
        }

    </style>
</head>
<%
  /*  request.setCharacterEncoding("utf-8");
    response.setContentType("text/html;charset=utf-8");

    long id =Integer.parseInt(request.getParameter("id"));

    Goods p = new Goods();


    GoodsDao dao = DaoFactory.getGoodsDao();
    p=dao.findGoodsById(id);*/

%>
<body>
<center>
    <h2>更新产品信息</h2>
    <form action="/update" method="post">
        <table border="0" >
        <c:forEach items="${goods}" var="g" varStatus="st">
            <tr>
                <td>编号</td>
                <td>
                    <input type="text" name="id" readonly="readonly" value=${g.id} >
                </td>
            </tr>
            <tr>
                <td>名称</td>
                <td>
                    <input style="color:#7a7a7a" type="text" name="name" value=${g.name} >
                </td>
            </tr>
            <tr>
                <td>数量</td>
                <td>
                    <input style="color:#7a7a7a" type="text" name="amount" value=${g.amount} >
                </td>
            </tr>
            <tr>
                <td>价格</td>
                <td>
                    <input style="color:#7a7a7a" type="text" name="price" value=${g.price} >
                </td>
            </tr>

        </c:forEach>
        </table>
        <input type="submit" value="提交"/>&nbsp;&nbsp;
        <input type="reset" value="重置"/>
    </form>
</center>
</body>
</html>

